import { defineStore } from "pinia";
import { getsearch } from "@/Api/shoop/index";
// 筛选
export const useSearchStore = defineStore("search", {
  state: () => ({
    count: [],
    address: [],
    flg:false
  }),

  actions: {},
});

// 全部标讯
export const useRadio1Store = defineStore("radio1", {
  state: () => ({
    title: {},
    // 全部标讯
    id: "1",
    total: "",
    dataLiss: {},
    count: {},
    page: {
      currentPage: 1,
      pageSize: 10,
    },
  }),
  actions: {
    getsearch() {
      this.dataLiss = {};
      getsearch({ ...this.title, ...this.count, ...this.page }).then((res) => {
        let {
          data: { data },
        } = res;
        this.dataLiss = data;
        if (data.count > 300) {
          this.total = 300;
        } else {
          this.total = data.count;
        }

        console.log(data);
      });
    },
  },
});
